<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html lang="zh">
<head>
<base href="/erp/static/">
<meta charset="UTF-8">
<title>用户列表</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" type="text/css" href="common/layui/css/layui.css"
	media="all">
<link rel="stylesheet" type="text/css"
	href="common/bootstrap/css/bootstrap.css" media="all">
<link rel="stylesheet" type="text/css" href="common/global.css"
	media="all">
<link rel="stylesheet" type="text/css" href="css/personal.css"
	media="all">
</head>
<body>
	<section class="layui-larry-box">
		<div class="larry-personal">
			<blockquote class="layui-elem-quote">
				<form action="/erp/user/list" class="layui-form layui-searchform"
					id="form">
					<input type="hidden" name="currentPage" id="currentPage"
						value="${pageBean.currentPage}">
					<div class="layui-searchform-item">
						<%-- <div class="layui-inline">
							<!-- <label class="layui-searchform-label">编号：</label> -->
							<div class="layui-input-inline" style="width: 100px;">
								<input type="text" name="id" placeholder="用户id"
									autocomplete="off" class="layui-input" value="${id }">
							</div>
						</div> --%>
						<div class="layui-inline" style="padding-left: 15px;">
							<!-- <label class="layui-searchform-label">用户名：</label> -->
							<div class="layui-input-inline" style="width: 100px;">
								<input type="text" name="name" placeholder="用户名"
									autocomplete="off" class="layui-input" value="${name }">
							</div>
						</div>
						<div class="layui-inline" style="padding-left: 15px;">
							<div class="layui-input-inline" style="width: 100px;">
								<!-- <button class="layui-btn" id="searchBtn">查询</button> -->
								<button class="layui-btn" lay-submit lay-filter="test">查询</button>
							</div>
						</div>

					</div>
					<!-- <div class="layui-inline">
						<label class="layui-form-label ">用户名</label>
						<div class="layui-input-inline" style="width: 100px;">
							<input type="text" name="price_min" placeholder="用户名"
								autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">范围</label>
						<div class="layui-input-inline" style="width: 100px;">
							<input type="text" name="price_min" placeholder="用户名"
								autocomplete="off" class="layui-input">
						</div>
					</div> -->
					<!-- <div class="layui-form-item">
							<div class="layui-inline">
								<label class="layui-form-label">范围</label>
								<div class="layui-input-inline" style="width: 100px;">
									<input type="text" name="price_min" placeholder="用户名"
										autocomplete="off" class="layui-input">
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label">密码</label>
								<div class="layui-input-inline" style="width: 100px;">
									<input type="password" name="" autocomplete="off"
										class="layui-input">
								</div>
							</div>

						</div> -->
				</form>
			</blockquote>

			<!-- <div class="larry-personal-body clearfix"> -->
			<div class="layui-field-box layui-show">
				<div class="layui-table-toolbar">
					<button class="layui-btn  layui-btn-small " name="btnAdd"
						id="btnAdd">
						<i class="layui-icon">&#xe608;</i> 添加
					</button>
					<button class="layui-btn layui-btn-small  layui-btn-normal"
						style="margin-left: 0px;" name="btnEdit" id="btnEdit">
						<i class="layui-icon">&#xe642;</i> 修改
					</button>
					<button class="layui-btn  layui-btn-small  layui-btn-danger"
						style="margin-left: 0px;" id="btnDel" name="btnDel">
						<i class="layui-icon">&#xe640;</i> 删除
					</button>
				</div>
				<table class="layui-table" lay-even="">
					<thead>
						<tr>
							<th><input type="checkbox" id="selected-all"></th>
							<th style="text-align: center;">编号</th>
							<th>名称</th>
							<th>创建时间</th>
							<!-- <th>操作</th> -->
						</tr>
					</thead>
					<tbody>
						<c:forEach var="user" items="${pageBean.objList}">
							<tr>
								<td><input type="checkbox" name="chxIds" value="${user.id}"></td>
								<td style="text-align: center;">${user.id}</td>
								<td>${user.name}</td>
								<td class="center"><c:if test="${user.createTime != null}">
										<fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss"
											value="${user.createTime}" />
									</c:if></td>
								<!-- <td>-</td> -->
							</tr>
						</c:forEach>
					</tbody>
				</table>
				<div class="larry-table-page clearfix">
					<div id="page" class="page"></div>
				</div>
			</div>

		</div>

		<!-- </div> -->
	</section>
	<script type="text/javascript" src="common/layui/layui.js"></script>
	<script type="text/javascript" src="js/modules/user/list.js"></script>
	<script type="text/javascript">
		layui.use([ 'jquery', 'layer', 'element', 'laypage', 'form' ],
				function() {
					window.jQuery = window.$ = layui.jquery;
					//window.layer = layui.layer;
					layer = parent.layer === undefined ? layui.layer : parent.layer;
					var element = layui.element();
					var laypage = layui.laypage;
					var form = layui.form();// 获取form组件

					/** *********************************************** */
					/** 分页功能****************************************** */
					/** *********************************************** */
					laypage({
						cont : 'page',
						pages : '${pageBean.totalPages}',// 总页数
						groups : 5,// 连续显示分页数
						skin : '#c00',
						curr : function() {
							return '${pageBean.currentPage}';
							// 通过url获取当前页，也可以同上（pages）方式获取
							// var page = location.search.match(/page=(\d+)/);
							// return page ? page[1] : 1;
						}(),
						jump : function(e, first) { // 触发分页后的回调
							if (!first) { // 一定要加此判断，否则初始时会无限刷新
								// submit();
								$("#currentPage").val(e.curr); // 需要设置要跳转的页面
								// alert($("#currentPage").val());
								$("#form").submit(); // form提交
								// alert($("#test").click());
								// $("#test").click();
								// location.href = '/erp/user/list?currentPage='
								// + e.curr + "&id=" + $("#id").val()
								// + "&name=" + $("#name").val();
							}
						},
						skip : true
					});

				});
	</script>
</body>
</html>